<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>

export default {
  name: 'App',
//解决浏览器刷新后 Vuex 数据消失问题
  mounted() {
    window.addEventListener('unload', this.saveState);
  },
  methods: {
    saveState() {
      sessionStorage.setItem('state', JSON.stringify(this.$store.state));
    }
  }
}
</script>

<style>
#app {

  text-align: center;
  color: #2c3e50;

}
</style>
